<!-- App.vue -->
<template>
  <router-view></router-view>
  <!-- <van-watermark
    :width="300"
    :opacity="0.3"
    :height="120"
    :content="waterMarkText"
  /> -->
</template>

<script setup>
import { ref, watch } from "vue";
import { useRoute } from "vue-router";

const cachedRoutes = ref([]);
const route = useRoute();

watch(
  route,
  (newVal) => {
    if (newVal.meta.keepAlive && !cachedRoutes.value.includes(newVal.name)) {
      cachedRoutes.value.push(newVal.name);
    }
  },
  { immediate: true }
);
</script>
